package com.zjq.authoritysystem.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * <p>
 *
 * </p>
 *
 * @author BetOnMe
 * @since 2023-09-18
 */
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "Department对象", description = "")
public class Department implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty(value = "名称")
    private String name;

    @ApiModelProperty(value = "部门电话")
    private String phone;

    @ApiModelProperty(value = "部门地址")
    private String address;

    /**
     * 顶级部门编号
     */
    public static final Integer PARENT_ID_TOP = 0;

    @ApiModelProperty(value = "所属部门编号")
    private Integer parentId;

    @ApiModelProperty(value = "所属部门名称")
    private String parentName;

    @ApiModelProperty(value = "排序")
    private Integer sort;

    /**
     * 未删除
     */
    public static final Integer IS_DELETE_NO = 0;

    /**
     * 已删除
     */
    public static final Integer IS_DELETE_YES = 1;

    @ApiModelProperty(value = "是否删除(0，未删除，1：已删除)")
    private Integer isDelete;

    /**
     * 子部门
     */
    @TableField(exist = false)
    private List<Department> children = new ArrayList<>();

}
